package com.ruoyi.sl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sl.mapper.SlSocialMapper;
import com.ruoyi.sl.domain.SlSocial;
import com.ruoyi.sl.service.ISlSocialService;

/**
 * 社保维护Service业务层处理
 * 
 * @author admin
 * @date 2024-06-17
 */
@Service
public class SlSocialServiceImpl implements ISlSocialService 
{
    @Autowired
    private SlSocialMapper slSocialMapper;

    /**
     * 查询社保维护
     * 
     * @param socialId 社保维护主键
     * @return 社保维护
     */
    @Override
    public SlSocial selectSlSocialBySocialId(Long socialId)
    {
        return slSocialMapper.selectSlSocialBySocialId(socialId);
    }

    /**
     * 查询社保维护
     *
     * @param userName 用户名
     * @return 社保维护
     */
    public SlSocial selectSlSocialByUserName(String userName){
        return slSocialMapper.selectSlSocialByUserName(userName);
    }

    /**
     * 查询社保维护
     *
     * @param userName 用户名
     * @return 社保维护
     */
    public SlSocial selectOnlySlSocialByUserName(String userName){
        return slSocialMapper.selectOnlySlSocialByUserName(userName);
    }

    /**
     * 查询社保维护列表
     * 
     * @param slSocial 社保维护
     * @return 社保维护
     */
    @Override
    public List<SlSocial> selectSlSocialList(SlSocial slSocial)
    {
        return slSocialMapper.selectSlSocialList(slSocial);
    }

    /**
     * 新增社保维护
     * 
     * @param slSocial 社保维护
     * @return 结果
     */
    @Override
    public int insertSlSocial(SlSocial slSocial)
    {
        slSocial.setCreateTime(DateUtils.getNowDate());
        return slSocialMapper.insertSlSocial(slSocial);
    }

    /**
     * 修改社保维护
     * 
     * @param slSocial 社保维护
     * @return 结果
     */
    @Override
    public int updateSlSocial(SlSocial slSocial)
    {
        slSocial.setUpdateTime(DateUtils.getNowDate());
        return slSocialMapper.updateSlSocial(slSocial);
    }

    /**
     * 批量删除社保维护
     * 
     * @param socialIds 需要删除的社保维护主键
     * @return 结果
     */
    @Override
    public int deleteSlSocialBySocialIds(Long[] socialIds)
    {
        return slSocialMapper.deleteSlSocialBySocialIds(socialIds);
    }

    /**
     * 删除社保维护信息
     * 
     * @param socialId 社保维护主键
     * @return 结果
     */
    @Override
    public int deleteSlSocialBySocialId(Long socialId)
    {
        return slSocialMapper.deleteSlSocialBySocialId(socialId);
    }
}
